package cn.com.wantools.service.provider;

import cn.com.wantools.model.unitconvert.UcConvertType;
import cn.com.wantools.model.unitconvert.UcGroup;
import cn.com.wantools.service.UcConvertTypeService;
import cn.com.wantools.service.UcGroupService;
import io.jboot.aop.annotation.Bean;
import io.jboot.service.JbootServiceBase;

import java.util.List;
import java.util.stream.Collectors;

@Bean
public class UcGroupServiceProvider
     extends JbootServiceBase<UcGroup> implements UcGroupService {

    @Override
    public List<UcGroup> loadUcGroup() {
        return findAll()
                .stream()
                .filter(x -> (x.getVisibleFlag() != null && x.getVisibleFlag().equals(1)))
                .collect(Collectors.toList());
    }
}
